﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BulldogCMS.Data.FilesTree;
using System.Xml.Linq;

namespace BulldogCMS.Data.Tests
{
    [TestClass]
    public class XMLFileTreeProviderTest
    {
        private IFilesTreeProvider CreateFilesTreeProvider()
        {
            XDocument xDoc = XDocument.Load(TestingData.ReflectionHelper.GetResourceStream("BulldogCMS.Data.Tests.TestingData.VolksbankWeb.xml"));
            return new XMLFilesTreeProvider(xDoc);
        }

        [TestMethod]
        public void LoadingRootFileNodes()
        {
            IFilesTreeProvider provider = this.CreateFilesTreeProvider();
            Assert.AreEqual(3, provider.PartialNodes.Count(), "Nodes count is not expected");
        }
    }
}
